package com.demo.timer;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;

/**
 * FileName: MyTimer.java
 * 类的详细说明
 *
 * @author Pretty_Boy
 * @version 1.00
 * @Date 2018/9/2719:10
 */
public class MyTimer extends Timer {
    public static void main(String[] args) {
        Date date = new Date();
        /**创建一个定时器*/
        Timer timer = new Timer();
        /**创建一个定时任务*/
        MyTimerTask myTimerTask = new MyTimerTask("task1");
        MyTimerTask myTimerTask2 = new MyTimerTask("task2");

        timer.schedule(myTimerTask,date,2000);
        timer.schedule(myTimerTask2,date,2000L);
    }


}
